<%@page import="leave.dataaccess.DAOFactory"%>
<%@page import="leave.dataaccess.LeaveDAO"%>
<%@page import="leave.model.*"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="header.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
int leaveID = Integer.parseInt(request.getParameter("leaveID"));
LeaveDAO leaveDAO = DAOFactory.getInstance().getLeaveDAO();
Leave leave = leaveDAO.getLeaveByID(leaveID);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<fmt:setBundle basename="TextForManagerPage" />
<title><fmt:message key="approveleave.details.title"/></title>
<link rel="stylesheet" href="css/style.css" type="text/css">

</head>
<body>
<form action="/LeaveApplication/ApproveLeavesServlet" method="post">
<table width="100%">
<tr>
<td class="title" align="left" colspan="2" height="40px"><fmt:message key="approveleave.details.title"/></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.leaveid"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getLeaveID() %>" name="leaveID" readonly="true"><td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.leavetype"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getLeaveType() %>" name="leaveType" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.appliedby"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getAppliedBy().getName() %>" name="appliedBy" readonly="true">
<input type="hidden" name="appliedEmpID" value="<%=leave.getAppliedBy().getEmployeeID() %>">
</td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.startdate"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getStartDate() %>" name="startDate" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.enddate"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getEndDate() %>" name="endDate" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.details.employeecomment"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getEmployeeComment() %>" name="employeeComment" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.details.employeecontactdetails"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getContactDetails() %>" name="contactDetails" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header" height="30px"><fmt:message key="approveleave.details.workdissemination"/> :</td>
<td width="76%" class="list" height="30px"><input type="text" style="border: none" value="<%=leave.getWorkDissemination() %>" name="workDissemination" readonly="true"></td>
</tr>
<tr>
<td width="24%" class="header"><fmt:message key="approveleave.details.managercomment"/> :</td>
<td width="76%" class="list" ><input type="textarea" name="managerComment" style="styled">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="approve" value="<fmt:message key="form.approve"/>">
<input type="submit" name="reject" value="<fmt:message key="form.reject"/>">
</td>
</tr>
</table>
</form>
</body>
</html>